﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

using Utilities.IO;

namespace Utilities.Media.Audio
{
    public abstract class AudioStream : DataStream
    {
        public short NumChannels { get; protected set; }
        public int SampleRate { get; protected set; }
        public short BitsPerSample { get; protected set; }

        public TimeSpan BufferDuration { get; set; }

        public TimeSpan TimePosition { get; protected set; }

        // EndOfStream ?

        public AudioStream(Stream stream) : base(stream)
        {
            TimePosition = TimeSpan.Zero;
            BufferDuration = new TimeSpan(0, 0, 5);
        }

        public abstract AudioBuffer ReadBuffer();
        public abstract void WriteBuffer(AudioBuffer buffer);
    }
}
